﻿@inject IStringLocalizer<Logout> L
@* @inject IAuthenticationService AuthService *@

<MudDialog>
    <TitleContent>
        <MudText Typo="Typo.h6">
            <MudIcon Icon="@Icons.Material.Filled.Logout" Class="mr-3 mb-n1" />
            @L["Logout Confirmation"]
        </MudText>
    </TitleContent>
    <DialogContent>
        <MudText>@ContentText</MudText>
    </DialogContent>
    <DialogActions>
        <MudButton StartIcon="@Icons.Material.Filled.Cancel" OnClick="Cancel">@L["Cancel"]</MudButton>
        <MudButton StartIcon="@Icons.Material.Filled.Logout" Color="@Color" Variant="Variant.Filled" OnClick="Submit">@ButtonText</MudButton>
    </DialogActions>
</MudDialog>

@code {
    [Parameter] public string? ContentText { get; set; }

    [Parameter] public string? ButtonText { get; set; }

    [Parameter] public Color Color { get; set; }

    [CascadingParameter] MudDialogInstance MudDialog { get; set; } = default!;

    async Task Submit()
    {
        //await AuthService.LogoutAsync();
        Snackbar.Add(@L["Logged out"], Severity.Info);
        MudDialog.Close(DialogResult.Ok(true));
    }

    void Cancel() =>
    MudDialog.Cancel();
}